package com.springboot.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 1.通过继承HttpServlet，来开发原生的Servlet
 * 2.@WebServlet 标识将 Servlet_对象/bean注入到容器中
 * 3.@WebServlet(urlPatterns = {"/servlet1","/servlet2"}),对servlet的urlPatterns进行配置
 * 注意：注入的原生的servlet_ 不会被springboot的拦截器拦截器进行拦截
 * 4.对于原生开发的servlet，需要使用 @ServletComponentScan 注解指定要扫描的servlet所在的包
 *
 */
//@WebServlet(urlPatterns = {"/servlet01","/servlet02"})
public class Servlet_ extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.getWriter().write("hello,Servlet_");
    }
}
